﻿{% extends 'base.html' %}
<!--覆写title区块 -->
{% block title %}查询结果{% endblock %}
 <!--覆写content区块 -->
{% block content %}
<script type="text/javascript">
function myFunction(ID,TYPE)
{
	id="#"+ID;
	//var URL="http://120.77.57.236:8080/feedback/like"+"?id="+ID+"&type="+TYPE;
	//var URL="/like?id="+ID+"&type="+TYPE; 
	$.get("/like/",{'id':ID,'type':TYPE},$(id).show());
}
</script>
<div class="container">
	<!--导航栏 -->
	<div class="row" id="nav">
		<div class="col-md-11">
		<span></span>
		<ul class="nav nav-tabs">
			  <li role="presentation" class="active"><a href="#">主页</a></li>
			  <li role="presentation"><a href="#">图书</a></li>
			  <li role="presentation"><a href="#">论文</a></li>
			  <li style="float:right "><a class="btn btn-primary" type="button" href="/">返回主页</a></li>
		</ul>
		</div>
	</div>
	<!--图形，保持格式 -->
	<div class="row" id="icon">
		<div class="col-md-11">
		<span class="glyphicon glyphicon-cloud" aria-hidden="true"></span>
		当前关键词(字)：{{keyword}}
		</div>
	</div>
	<!--按项展示查询结果 -->
	<div class="row" id="content">
			<div class="col-md-6" style="min-height:550px;overflow-y:auto;max-height:300px;font-size:20px;">
			<a href="#" class="list-group-item active">图书查询结果</a>
			<table class="table table-hover" >
				<tr class="info" style="height:75px;">
					<td>标题</td>
					<td>作者</td>
					<td>标识</td>
					<td>分类</td>
					<td><font size="2px">出版日期</font ></td>
					<!--<td><font size="2px">点击数</font></td>-->
				</tr>
				
				{%for item in res_book%}
				<tr data-toggle="modal" data-target="#myModal{{item.callId}}">
					<!-- 模态框（Modal） -->
					<div class="modal fade" id="myModal{{item.callId}}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-dialog">
							<div class="modal-content">
								<div class="modal-header">
									<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
									<h4 class="modal-title" id="myModalLabel">《{{item.title}}》的详细资料</h4>
								</div>
								<div class="modal-body">图书ID：{{item.callId}}<br>作者：{{item.author}}<br>出版社：{{item.publisher}}<br>出版年月：{{item.pubYear}}<br>中图法分类：{{item.callName}}</div>
								<div class="modal-footer">
									<!--<a class="btn btn-primary" target="none" type="button" href="http://120.77.57.236:8080/feedback/like?id={{item.id}}&type=book">赞</a>-->
									<label id="{{item.id}}" style="color: red;display: none">谢谢反馈！</label>
									<button type="button" class="btn btn-primary" onclick="myFunction({{item.id}},'book')" id="bookLike">赞</button>
									<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
								</div>
							</div><!-- /.modal-content -->
						</div><!-- /.modal -->
					</div>
					<td><font size="2px"><a href='/recommend/?id={{item.id}}&type=book&weight='>{{item.title}}</a></font></td>
					<td><font size="2px">{{item.author}}</font></td>
					<td><font size="2px">{{item.callId}}</font></td>
					<td><font size="2px">{{item.callName}}</font></td>
					<!--<td>{{item.publisher}}</td>-->
					<td><font size="2px">{{item.pubYear}}</font></td>
					<!--<td>{{item.likeCount}}</td>-->
				</tr>
				{%endfor%}
			</table>
			<!--推荐books：<br>
			{%for item in res_book%}
			{{item.title}}<br>
			{%endfor%}!-->
			</div>
			<div class="col-md-5" style="min-height:550px;overflow-y:auto;max-height:300px;font-size:20px;">
			<a href="#" class="list-group-item active">论文查询结果</a>
			<table class="table table-hover" >
				<tr class="info" style="height:75px;">
					
					<td>标题</td>
					<td>来源</td>
					<td>领域</td>
					<td><font size="2px">关键词</font></td>
					<!--<td><font size="2px">点击数</font></td>-->
					
				</tr>
				{%for item in res_paper%}
				<tr title={{item.intro}} data-toggle="modal" data-target="#myModal{{item.id}}">
				    <!-- 模态框（Modal） -->
					<div class="modal fade" id="myModal{{item.id}}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
						<div class="modal-dialog">
							<div class="modal-content">
								<div class="modal-header">
									<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
									<h4 class="modal-title" id="myModalLabel">《{{item.title}}》的详细资料</h4>
								</div>
								<div class="modal-body">论文ID：{{item.paperId}}<br>链接：{{item.url}}<br>简介：{{item.intro}}</div>
								<div class="modal-footer">
									<label id="{{item.id}}" style="color: red;display: none">谢谢反馈！</label>
									<button type="button" class="btn btn-primary" onclick="myFunction({{item.id}},'paper')" id="bookLike">赞</button>
									<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
								</div>
							</div><!-- /.modal-content -->
						</div><!-- /.modal -->
					</div>
					<td><font size="2px"><a href='/recommend/?id={{item.id}}&type=paper&weight='>{{item.title}}</a></font></td>
					<td><font size="2px">{{item.author}}</font></td>
					<!--<td><font size="2px"><a href={{item.url}}>{{item.paperId}}</a></font></td>-->
					<td><font size="2px">{{item.field}}</font></td>
					<td><font size="2px">{{item.indexTerm}}</font></td>
					<!--<td>{{item.likeCount}}</td>-->
				</tr>
				{%endfor%}
			</table>
			<!--推荐papers：<br>
			{%for item in res_paper%}
			{{item.title}}<br>
			{%endfor%}-->
			</div>
		</div>
</div>
{% endblock %}